﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using LPY.LeHealth.DAL;
using LPY.LeHealth.DTO;
using LPY.LeHealth.Model;

namespace LPY.LeHealth.Service
{
     public  class AppService
    {
         private AppDAL adal;
         private CityDal cityDal;
         public AppService()
        {
            cityDal = new CityDal();
            adal = new AppDAL();
        }
        
         /// <summary>
         /// 显示评论表
         /// </summary>
         /// <returns></returns>
         public List<AppDTO> getapp()
         {
             return adal.show();
             
         }

         /// <summary>
         /// 显示全部评论表
         /// </summary>
         /// <returns></returns>
         public List<AppModel> getappall()
         {

             List<AppModel> list = adal.showall();
             return list;
         }
         public List<AppModel> plshow(int uid)//记录登录用户的ID 
         {
             return adal.plshow(uid);
         }

         public List<AppModel> plshowwei(int uid)//记录登录用户的ID 
         {
             return adal.plshowwei(uid);
         }

         public List<imageModel> getimage()//获取图片表数据
         {
             return adal.getimage();
         }

         /// <summary>
         /// 获取前7个城市
         /// </summary>
         /// <returns></returns>
         public List<City> GetTop7()
         {
             return cityDal.getcityTop7(7);
         }

        /// <summary>
         /// 获取所有城市
        /// </summary>
        /// <returns></returns>
        public List<City> GetAll()
        {
            return cityDal.getcity();
        }

        /// <summary>
        /// 获取地址名称
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public List<City> getName(int Id)
        {
            return cityDal.getName(Id);
        }

    }
}
